﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using System.Data.SqlClient;
using System.Resources;
using System.Globalization;


namespace atm_qlda
{
    public partial class chooseReport : Form
    {
        CultureInfo culture;
        string language;
        string sus;
        string id;
        public chooseReport()
        {
            InitializeComponent();
        }

        public delegate void delegateSend(string id, string language);

        private void chooseReport_Load(object sender, EventArgs e)
        {

        }

        public void chuyendl3(string chuoi, string lag)
        {
            this.id = chuoi;
            this.language = lag;
        }
        public void SetLanguage(string cultureName)
        {

            culture = CultureInfo.CreateSpecificCulture(cultureName);
            ResourceManager rm = new ResourceManager("atm_qlda.Lang.MyResource", typeof(chooseReport).Assembly);
            label1.Text = rm.GetString("bank", culture);
            label2.Text = rm.GetString("sus", culture);
            label3.Text = rm.GetString("choosereport", culture);
            lbno.Text = rm.GetString("no", culture);
            lbyes.Text = rm.GetString("yes", culture);
            sus = rm.GetString("susrp",culture);
        }

        private void bttyes_Click(object sender, EventArgs e)
        {


            if (MessageBox.Show(sus, "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No)
                Application.Exit();
            else
            { 
                Choose cs= new Choose();
                delegateSend dele = new delegateSend(cs.chuyendl);
                dele(this.id, this.language);
                cs.SetLanguage(language);
                  cs.Show();
                this.Hide();

            }

        }

        private void bttno_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(sus, "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.No)
                Application.Exit();
            else
            { 
                Choose cs= new Choose();
                delegateSend dele = new delegateSend(cs.chuyendl);
                dele(this.id, this.language);
                cs.Show();
                cs.SetLanguage(language);
                this.Hide();
            }
        }
    }
}
